package com.cskaoyan.controller.front.footprint;

import com.cskaoyan.bean.po.BaseParam;
import com.cskaoyan.bean.vo.back.BaseRespVo;
import com.cskaoyan.bean.vo.back.admin.BaseDataVo;
import com.cskaoyan.service.front.footprint.FootPrintService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;


@RequestMapping("wx")
@RestController
public class FootprintController {

    @Autowired
    FootPrintService footPrintService;

    @GetMapping("footprint/list")
    public BaseRespVo footprintList(BaseParam param) {
        BaseDataVo footPrintList = footPrintService.getFootprintList(param);
        return BaseRespVo.ok(footPrintList);
    }

    @PostMapping("footprint/delete")
    public BaseRespVo footprintDelete(Map param) {
//        获取足迹商品id
        Integer id = (Integer)(param.get("id"));
        footPrintService.deleteFootPrint(id);
        return BaseRespVo.ok();
    }
}
